package com.lz;

import org.junit.Test;

import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

/**
 * @description
 *
 * @date 2021-12-20 21:11
 *
 * @author Lizhong
 */
public class dsd {

    // 011011
    // 110110

    //
    // 0
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = Integer.parseInt(in.nextLine());
        String s1 = in.nextLine();
        String s2 = in.nextLine();
        in.close();
        extracted(n, s1, s2);
    }

    @Test
    public void test() {
        // 6
        // 011011
        // 110110
        extracted(6, "011011", "110110");
        extracted(3, "010", "110");
    }

    private static void extracted(int n, String s1, String s2) {
        int ret = 0;

        int dp[] = new int[4];
        for (int i = 0; i < n; i++) {
            char c1 = s1.charAt(i);
            char c2 = s2.charAt(i);

            if (c1 == '1' && c2 == '1') {
                dp[2]++;
            } else if (c1 == '0' && c2 == '0') {
                dp[0]++;
            } else if (c1 == '1' && c2 == '0') {
                dp[1]++;
            } else if (c1 == '0' && c2 == '1') {
                dp[3]++;
            }

        }
        ret = dp[0] * dp[2] + dp[1] * dp[0] + dp[1] * dp[3];
        System.out.println(ret);
    }

    public static void main0(String args[]) {
        Scanner in = new Scanner(System.in);
        String[] split = in.nextLine().split(" ");
        int R = Integer.parseInt(split[2]);
        List<Integer> A = Arrays.stream(in.nextLine().split(" ")).map(Integer::parseInt).collect(Collectors.toList());
        List<Integer> B = Arrays.stream(in.nextLine().split(" ")).map(Integer::parseInt).collect(Collectors.toList());
        in.close();
        extracted(R, A, B);

    }

    @Test
    public void test002() {
        // extracted();
    }

    private static void extracted(int R, List<Integer> A, List<Integer> B) {
        Integer bMax = B.get(B.size()-1);
        Integer aMax = B.get(A.size()-1);
        for (int i = 0, j = 0; i < A.size() && j < B.size(); ) {
            int a = A.get(i);
            int b = B.get(j);
            if(a>bMax || aMax+R<b){
                break;
            }
            if (a <= b && b - a <= R) {
                System.out.println(a + " " + b);
                i++;
                j++;
            } else if (a > b) j++;
            else {
                i++;
            }
        }
    }
}
